﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using VitCode.ObjectResolutionHelper;

namespace VitCode.Castle.Entities
{
    [OrMemo("企业信息")]
    public class Enterprise : BaseEntity
    {
        protected string m_Name;


        [OrMemo("企业名称")]
        public virtual string Name
        {
            get { return m_Name; }
            set { m_Name = value; }
        }

        protected string m_Website;


        [OrMemo("网址")]
        public virtual string Website
        {
            get { return m_Website; }
            set { m_Website = value; }
        }

        protected string m_ContactPerson;

 
        [OrMemo("联系人")]
        public virtual string ContactPerson
        {
            get { return m_ContactPerson; }
            set { m_ContactPerson = value; }
        }

        protected string m_Mobile;

        [OrMemo("联系电话")]
        public virtual string Mobile
        {
            get { return m_Mobile; }
            set { m_Mobile = value; }
        }

        protected string m_Fax;

        [OrMemo("传真")]
        public virtual string Fax
        {
            get { return m_Fax; }
            set { m_Fax = value; }
        }

        protected string m_Address;

        [OrMemo("地址")]
        public virtual string Address
        {
            get { return m_Address; }
            set { m_Address = value; }
        }

        /// <summary>
        /// 重寫Equals方法
        /// </summary>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(obj, this))
                return true;
            if (obj == null)
                return false;
            var sObj = obj as Enterprise;
            return sObj != null && (sObj.Id == m_Id || (sObj.Name == m_Name));
        }

        /// <summary>
        /// 重寫GetHashCode方法
        /// </summary>
        public override int GetHashCode()
        {
            int hash = 44;
            hash = 27 * hash * m_Id.GetHashCode();
            return hash;
        }
    }
}
